const files = require.context('@/views', true, /routes\.js$/)
let routes = []

routes.push({
  path: '/',
  redirect: '/login'
})

routes.push({
  path: '*',
  redirect: '/404'
})

routes.push({
  path: '/404',
  component: () => import('@/views/404.vue'),
  hidden: true
})
files.keys().forEach(key => {
  routes = routes.concat(files(key).default)
})

export default routes
